<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NumCpp: NumCpp: A Templatized Header Only C++ Implementation of the [Python NumPy Library](http://www.numpy.org)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NumCpp
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">A C++ implementation of the Python Numpy library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('index.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">NumCpp: A Templatized Header Only C++ Implementation of the [Python NumPy Library](<a href="http://www.numpy.org">http://www.numpy.org</a>) </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2>Author: David Pilger <a href="#" onclick="location.href='mai'+'lto:'+'dpi'+'lg'+'er2'+'6@'+'gma'+'il'+'.co'+'m'; return false;">dpilg<span style="display: none;">.nosp@m.</span>er26<span style="display: none;">.nosp@m.</span>@gmai<span style="display: none;">.nosp@m.</span>l.co<span style="display: none;">.nosp@m.</span>m</a></h2>
<h2>Version: 1.3</h2>
<h2>License</h2>
<p>Copyright 2020 David Pilger</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<h2>Testing</h2>
<p><b>C++ Standards:</b> C++11, C++14, and C++17 <br />
**Compilers:** VS 2017/2019, GCC 7.4.0/8.3/9.1, and Clang 6.0/8.0/9.0 <br />
**Boost Versions:** 1.68 and 1.70 <br />
 </p><h2><a href="https://dpilger26.github.io/NumCpp">Documentation</a></h2>
<h2><a href="https://github.com/dpilger26/NumCpp">GitHub</a></h2>
<h2><a href="https://dpilger26.github.io/NumCpp/doxygen/html/md__c_1__users_pilgeda__documents__git_hub__num_cpp_install__r_e_a_d_m_e.html">Installation</a></h2>
<h2>From NumPy To NumCpp – A Quick Start Guide</h2>
<p>This quick start guide is meant as a very brief overview of some of the things that can be done with <b>NumCpp</b>. For a full breakdown of everything available in the <b>NumCpp</b> library please visit the <a href="https://dpilger26.github.io/NumCpp">Full Documentation</a>.</p>
<h3>CONTAINERS</h3>
<p>The main data structure in <b>NumCpp</b> is the <code>NdArray</code>. It is inherently a 2D array class, with 1D arrays being implemented as 1xN arrays. There is also a <code>DataCube</code> class that is provided as a convenience container for storing an array of 2D <code>NdArray</code>s, but it has limited usefulness past a simple container.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a = np.array([[1, 2], [3, 4], [5, 6]])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library. ">nc::NdArray</a>&lt;int&gt; a = { {1, 2}, {3, 4}, {5, 6} }</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a.reshape([2, 3])</code>  </td><td class="markdownTableBodyCenter"><code>a.reshape(2, 3)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.astype(np.double)</code>  </td><td class="markdownTableBodyCenter"><code>a.astype&lt;double&gt;()</code>   </td></tr>
</table>
<h3>INITIALIZERS</h3>
<p>Many initializer functions are provided that return <code>NdArray</code>s for common needs.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linspace(1, 10, 5)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a672fbcbd2271d5fc58bd1b94750bbdcc">nc::linspace</a>&lt;dtype&gt;(1, 10, 5)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.arange(3, 7)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a465e2385ac78ca4cc23928a4a0cd9f53">nc::arange</a>&lt;dtype&gt;(3, 7)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.eye(4)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a14b8af9690ed6002ac7b6601f2919fa7">nc::eye</a>&lt;dtype&gt;(4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.zeros([3, 4])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a003b8abd8ec4640d8fcbc6d2c4872baf">nc::zeros</a>&lt;dtype&gt;(3, 4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library. ">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 0</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.ones([3, 4])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a60a5797687e15e70c20c947d90f40fec">nc::ones</a>&lt;dtype&gt;(3, 4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library. ">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 1</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.nans([3, 4])</code>  </td><td class="markdownTableBodyCenter"><code>nc::nans(3, 4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library. ">nc::NdArray</a>&lt;double&gt;(3, 4) a = <a class="el" href="namespacenc_1_1constants.html#af94758715a9a5157d7ca95ab89d390ac" title="NaN. ">nc::constants::nan</a></code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.empty([3, 4])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a30fffe546dfa683048a1cb0d759b54a8">nc::empty</a>&lt;dtype&gt;(3, 4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library. ">nc::NdArray</a>&lt;dtype&gt;(3, 4) a</code>   </td></tr>
</table>
<h3>SLICING/BROADCASTING</h3>
<p><b>NumCpp</b> offers <b>NumPy</b> style slicing and broadcasting.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[2, 3]</code>  </td><td class="markdownTableBodyCenter"><code>a(2, 3)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[2:5, 5:8]</code>  </td><td class="markdownTableBodyCenter"><code>a(<a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays. ">nc::Slice(2, 5)</a>, <a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays. ">nc::Slice(5, 8)</a>)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a({2, 5}, {5, 8})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[:, 7]</code>  </td><td class="markdownTableBodyCenter"><code>a(a.rSlice(), 7)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5]</code>  </td><td class="markdownTableBodyCenter"><code>a[a &gt; 50]</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5] = 0</code>  </td><td class="markdownTableBodyCenter"><code>a.putMask(a &gt; 50, 666)</code>   </td></tr>
</table>
<h3>RANDOM</h3>
<p>The random module provides simple ways to create random arrays.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.random.seed(666)</code>  </td><td class="markdownTableBodyCenter"><code>nc::random::seed(666)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randn(3, 4)</code>  </td><td class="markdownTableBodyCenter"><code>nc::random::randn&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays. ">nc::Shape(3,4)</a>)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>nc::random::randn&lt;double&gt;({3, 4})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randint(0, 10, [3, 4])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays. ">nc::Shape(3,4)</a>,0,10)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;({3, 4},0,10)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.rand(3, 4)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a704fd7e62a0506a7e91074a8e8603fec">nc::random::rand</a>&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays. ">nc::Shape(3,4)</a>)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a704fd7e62a0506a7e91074a8e8603fec">nc::random::rand</a>&lt;double&gt;({3, 4})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.choice(a, 3)</code>  </td><td class="markdownTableBodyCenter"><code>nc::random::choice(a, 3)</code>   </td></tr>
</table>
<h3>CONCATENATION</h3>
<p>Many ways to concatenate <code>NdArray</code> are available.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.stack([a, b, c], axis=0)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a656bb4b9fecf40f1f4194964be57c78b">nc::stack</a>({a, b, c}, <a class="el" href="namespacenc.html#a5edb9ac6f596ae1256faa3f5d797dc84a54c1ed33c810f895d48c008d89f880b7">nc::Axis::ROW</a>)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.vstack([a, b, c])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a8dec1ff4db1d89ab4b3a7d32ff4b5cf3">nc::vstack</a>({a, b, c})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.hstack([a, b, c])</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a80a6677582b65c19750b0d82ac182081">nc::hstack</a>({a, b, c})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.append(a, b, axis=1)</code>  </td><td class="markdownTableBodyCenter"><code>nc::append(a, b, nc::Axis::COL)</code>   </td></tr>
</table>
<h3>DIAGONAL, TRIANGULAR, AND FLIP</h3>
<p>The following return new <code>NdArray</code>s.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diagonal(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::diagonal(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.triu(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::triu(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tril(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::tril(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.flip(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::flip(a, nc::Axis::ROW)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.flipud(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::flipud(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fliplr(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::fliplr(a)</code>   </td></tr>
</table>
<h3>ITERATION</h3>
<p><b>NumCpp</b> follows the idioms of the C++ STL providing iterator pairs to iterate on arrays in different fashions.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>for value in a</code>  </td><td class="markdownTableBodyCenter"><code>for(auto it = a.begin(); it &lt; a.end(); ++it)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>for(auto&amp; value : a)</code>   </td></tr>
</table>
<h3>LOGICAL</h3>
<p>Logical FUNCTIONS in <b>NumCpp</b> behave the same as <b>NumPy</b>.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.where(a &gt; 5, a, b)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ac0af750215d0444ad9f0208620ca206b">nc::where</a>(a &gt; 5, a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.any(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::any(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.all(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::all(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.logical_and(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::logical_and(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.logical_or(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::logical_or(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isclose(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::isclose(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.allclose(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::allclose(a, b)</code>   </td></tr>
</table>
<h3>COMPARISONS</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.equal(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::equal(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a == b</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.not_equal(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::not_equal(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a != b</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>rows, cols = np.nonzero(a)</code>  </td><td class="markdownTableBodyCenter"><code>auto [rows, cols] = nc::nonzero(a)</code>   </td></tr>
</table>
<h3>MINIMUM, MAXIMUM, SORTING</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.min(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::min(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.max(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::max(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.argmin(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::argmin(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argmax(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::argmax(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sort(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sort(a, nc::Axis::ROW)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argsort(a, axis=1)</code>  </td><td class="markdownTableBodyCenter"><code>nc::argsort(a, nc::Axis::COL)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.unique(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::unique(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.setdiff1d(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::setdiff1d(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diff(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::diff(a)</code>   </td></tr>
</table>
<h3>REDUCERS</h3>
<p>Reducers accumulate values of <code>NdArray</code>s along specified axes. When no axis is specified, values are accumulated along all axes.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sum(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sum(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sum(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sum(a, nc::Axis::ROW)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.prod(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::prod(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.prod(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::prod(a, nc::Axis::ROW)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.mean(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::mean(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.mean(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::mean(a, nc::Axis::ROW)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a, axis=0)</code>  </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a, nc::Axis::ROW)</code>   </td></tr>
</table>
<h3>I/O</h3>
<p>Print and file output methods. All <b>NumCpp</b> classes support a <code><a class="el" href="namespacenc.html#aafebf0f02106dfcc3ac3edbb4aa8b59d">print()</a></code> method and <code>&lt;&lt;</code> stream operators.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>print(a)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#aafebf0f02106dfcc3ac3edbb4aa8b59d">a.print()</a></code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>std::cout &lt;&lt; a</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.tofile(filename, sep=’\n’)</code>  </td><td class="markdownTableBodyCenter"><code>a.tofile(filename, "\n")</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fromfile(filename, sep=’\n’)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ae299ba41f67aeade5634e93fd8b417c9">nc::fromfile</a>&lt;dtype&gt;(filename, "\n")</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.dump(a, filename)</code>  </td><td class="markdownTableBodyCenter"><code>nc::dump(a, filename)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.load(filename)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#abec5f2e4d2a1598de762e32b839a3067">nc::load</a>&lt;dtype&gt;(filename)</code>   </td></tr>
</table>
<h3>MATHEMATICAL FUNCTIONS</h3>
<p><b>NumCpp</b> universal functions are provided for a large set number of mathematical functions.</p>
<h4>BASIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.abs(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::abs(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sign(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sign(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.remainder(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::remainder(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.clip(a, 3, 8)</code>  </td><td class="markdownTableBodyCenter"><code>nc::clip(a, 3, 8)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.interp(x, xp, fp)</code>  </td><td class="markdownTableBodyCenter"><code>nc::interp(x, xp, fp)</code>   </td></tr>
</table>
<h4>EXPONENTIAL FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.exp(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::exp(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.expm1(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::expm1(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.log(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::log(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.log1p(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::log1p(a)</code>   </td></tr>
</table>
<h4>POWER FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.power(a, 4)</code>  </td><td class="markdownTableBodyCenter"><code>nc::power(a, 4)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sqrt(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sqrt(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.square(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::square(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cbrt(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::cbrt(a)</code>   </td></tr>
</table>
<h4>TRIGONOMETRIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sin(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sin(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cos(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::cos(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tan(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::tan(a)</code>   </td></tr>
</table>
<h4>HYPERBOLIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sinh(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::sinh(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cosh(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::cosh(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tanh(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::tanh(a)</code>   </td></tr>
</table>
<h4>CLASSIFICATION FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.isnan(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::isnan(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isinf(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::isinf(a)</code>   </td></tr>
</table>
<h4>LINEAR ALGEBRA</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>  </th><th class="markdownTableHeadCenter"><b>NumCpp</b>   </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.norm(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::norm(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.dot(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::dot(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.det(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::linalg::det(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.inv(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::linalg::inv(a)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.lstsq(a, b)</code>  </td><td class="markdownTableBodyCenter"><code>nc::linalg::lstsq(a, b)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.matrix_power(a, 3)</code>  </td><td class="markdownTableBodyCenter"><code>nc::linalg::matrix_power(a, 3)</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>Np.linalg.multi_dot(a, b, c)</code>  </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1linalg.html#a86ab79e41b748e7ea0ee4f2e0bc462a6">nc::linalg::multi_dot</a>({a, b, c})</code>   </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.svd(a)</code>  </td><td class="markdownTableBodyCenter"><code>nc::linalg::svd(a)</code>   </td></tr>
</table>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
